import java.io.*;
import java.util.Scanner;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:ī��
 * Data:2023-08-29
 * Time:15:19
 */
public class MyIO {
    public static void main(String[] args) throws IOException {
        byte[] aa=new byte[100];

        try(InputStream inputStream=new FileInputStream("kk.txt")) {

            //System.out.println(inputStream.available());

            //System.out.println(inputStream.read());

            //从键盘上读取文件
            //Scanner scan=new Scanner(System.in);

            //此时就是从文件当中读取数据
            /*Scanner sc=new Scanner(inputStream);
            String s=sc.next();
            System.out.println(s);*/
            //int a=inputStream.read(aa);
        }
      try(OutputStream outputStream=new FileOutputStream("kk.txt"))
        {
            char[] array = {'你', '好', '世', '界'};
            //outputStream.write(22);
            System.out.printf("%x",(byte)array[0]);
            outputStream.write(60);
        }
        try {
            OutputStream outputStream = new FileOutputStream("kk.txt");
            PrintWriter printWriter = new PrintWriter(outputStream);

            printWriter.println("Hello, World!");
            printWriter.println("This is an example.");

            printWriter.close();
            outputStream.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
